﻿using DocumentFormat.OpenXml.Lite.DrawingML.Base;
using DocumentFormat.OpenXml.Lite.DrawingML.Geometry;
using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Text.Properties
{
    [XmlRoot("rPr", Namespace = Constants.Main)]
    public class RunProperties : XmlSerializable
    {
        #region Attributes

        [Optional]
        [XmlAttribute("kumimoji", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> Kumimoji { get; set; }

        [Optional]
        [XmlAttribute("lang", Form = XmlSchemaForm.Qualified)]
        public string LanguageId { get; set; }

        [Optional]
        [XmlAttribute("altLang", Form = XmlSchemaForm.Qualified)]
        public string AlternativeLanguage { get; set; }

        [Optional]
        [XmlAttribute("sz", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> FontSize { get; set; }

        [Optional]
        [XmlAttribute("b", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> Bold { get; set; }

        [Optional]
        [XmlAttribute("i", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> Italic { get; set; }

        [Optional]
        [XmlAttribute("u", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TextUnderlineType> UnderlineType { get; set; }

        [Optional]
        [XmlAttribute("strike", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TextStrikeType> Strikethrough { get; set; }

        [Optional]
        [XmlAttribute("cap", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_TextCapsType> Capitalization { get; set; }

        [Optional]
        [XmlAttribute("kern", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> Kerning { get; set; }

        [Optional]
        [XmlAttribute("spc", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> Spacing { get; set; }

        [Optional]
        [XmlAttribute("normalizeH", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> NormalizeHeights { get; set; }

        [Optional]
        [XmlAttribute("baseline", Form = XmlSchemaForm.Qualified)]
        public Nullable<int> Baseline { get; set; }

        [Optional]
        [XmlAttribute("noProof", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> NoProofing { get; set; }

        [Optional]
        [XmlAttribute("dirty", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> Dirty { get; set; }

        [Optional]
        [XmlAttribute("err", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> SpellingError { get; set; }

        [Optional]
        [XmlAttribute("smtClean", Form = XmlSchemaForm.Qualified)]
        public Nullable<bool> SmartTagClean { get; set; }

        [Optional]
        [XmlAttribute("smtId", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> SmartTagId { get; set; }

        [Optional]
        [XmlAttribute("bmk", Form = XmlSchemaForm.Qualified)]
        public string BookmarkLinkTarget { get; set; }

        #endregion

        #region Elements

        [Optional]
        [XmlElement("ln", Namespace = Constants.Main)]
        public Line Line { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public IFillProperty FillProperties { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public IEffectProperty EffectProperty { get; set; }

        [Optional]
        [XmlElement("highlight", Namespace = Constants.Main)]
        public Color.Color Highlight { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public ITextUnderlineLine TextUnderlineElement { get; set; }

        [Optional]
        [XmlElement("", Namespace = Constants.Main)]
        public ITextUnderlineFill TextUnderlineFill { get; set; }

        [Optional]
        [XmlElement("latin", Namespace = Constants.Main)]
        public Font.Font LatinFont { get; set; }

        [Optional]
        [XmlElement("ea", Namespace = Constants.Main)]
        public Font.Font EastAsianFont { get; set; }

        [Optional]
        [XmlElement("cs", Namespace = Constants.Main)]
        public Font.Font ComplexScriptFont { get; set; }

        [Optional]
        [XmlElement("sym", Namespace = Constants.Main)]
        public Font.Font SymbolicFont { get; set; }

        [Optional]
        [XmlElement("hlinkClick", Namespace = Constants.Main)]
        public Hyperlink ClickHyperlink { get; set; }

        [Optional]
        [XmlElement("hlinkMouseOver", Namespace = Constants.Main)]
        public Hyperlink MouseOverHyperlink { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Main)]
        public ExtensionList ExtensionList { get; set; }

        #endregion

        public RunProperties() { }
    }
}
